{include file="common/header.tpl"}
<body>
<div id="wrapper">
{include file="common/toptab.tpl"}

{* Check which item is currently active and set active tab to it*}
{if $smarty.get.sub1 eq "page"}
	{assign var="page" value="current"}
{else}
	{assign var="category" value="current"}
{/if}


{* Check which item is currently active and load correspond template*}
{if $smarty.get.sub1 eq "page"}
	<script src="../view/admin/js/module_page.js" type="text/javascript"></script>
	{if $smarty.get.act eq "newpage"}
		{include file="BgcmsContentManager/add_page.tpl"}
        <script src="../view/admin/js/tiny_mce/tiny_mce.js" type="text/javascript"></script>
		<script src="../view/admin/js/editor.js" type="text/javascript"></script>
	{elseif $smarty.get.act eq "editpage"}
    	<script src="../view/admin/js/tiny_mce/tiny_mce.js" type="text/javascript"></script>
		<script src="../view/admin/js/editor.js" type="text/javascript"></script>
		{include file="BgcmsContentManager/edit_page.tpl"}	
	{else}
		{include file="BgcmsContentManager/list_page.tpl"}
	{/if}
{else}
	
    
    <script src="../view/admin/js/module_category.js" type="text/javascript"></script>
	{if $smarty.get.act eq "newcategory"}
		{include file="BgcmsContentManager/add_category.tpl"}
	{elseif $smarty.get.act eq "editcategory"}
		{include file="BgcmsContentManager/edit_category.tpl"}
    {elseif $smarty.get.act eq "position"}
		{include file="BgcmsContentManager/position.tpl"}	    	
    {elseif $smarty.get.act eq "assign_page"}
		{include file="BgcmsContentManager/assign_page.tpl"}
    {elseif $smarty.get.act eq "assign_gallery"}
		{include file="BgcmsContentManager/assign_gallery.tpl"}
    {elseif $smarty.get.act eq "assign_product"}
		{include file="BgcmsContentManager/assign_product_list.tpl"}       	   	
	{else}
		{include file="BgcmsContentManager/list_category.tpl"}
        {include file="common/note.tpl"}
	{/if}
    
{/if}

</div>
</body>
</html>